Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BREAKING CHANGE: ADDomain: Change Domain Install Tracking File to NetLogon Registry Test and Refactor #566

Merged
merged 15 commits into from
Feb 12, 2020

Conversation

X-Guardian
Copy link
Contributor

@X-Guardian X-Guardian commented Feb 8, 2020

Pull Request (PR) description

This PR changes the ADDomain resource to use a NetLogon registry item test instead of a tracking file. The Get-TargetResource function is also refactored as follows:

  • Remove unused parameters.
  • Remove unnecessary domain membership check.
  • Remove unneeded catch exception blocks.
  • Change Get-ADDomain and Get-ADForest to use localhost as the server.
  • Improve Try/Catch blocks to only cover cmdlet calls.
  • Simplify retry timing loop.

The resource property checks were removed from the Test-TargetResource as these cannot be changed once the domain has been installed.

The ADDomain unit tests were also refactored.

The NewChildDomain example was also updated to clarify the contents of the credential parameter and use Windows 2016 rather than 2012 R2.

New ADDomain Integration tests were added.

The required PowerShell version for the module was increased from v4.0 to v5.0.

This Pull Request (PR) fixes the following issues

Task list

  • Added an entry to the change log under the Unreleased section of the
    file CHANGELOG.md. Entry should say what was changed and how that
    affects users (if applicable), and reference the issue being resolved
    (if applicable).
  • Resource documentation added/updated in README.md.
  • Resource parameter descriptions added/updated in README.md, schema.mof
    and comment-based help.
  • Comment-based help added/updated.
  • Localization strings added/updated in all localization files as appropriate.
  • Examples appropriately added/updated.
  • Unit tests added/updated. See DSC Community Testing Guidelines.
  • Integration tests added/updated (where possible). See DSC Community Testing Guidelines.
  • New/changed code adheres to DSC Community Style Guidelines.

This change is Reviewable

@codecov
Copy link

codecov bot commented Feb 8, 2020

Codecov Report

Merging #566 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #566   +/-   ##
=======================================
  Coverage   98.89%   98.89%           
=======================================
  Files          23       23           
  Lines        3087     3087           
=======================================
  Hits         3053     3053           
  Misses         34       34
Impacted Files Coverage Δ
...vicePrincipalName/MSFT_ADServicePrincipalName.psm1 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 05d7a56...a13ce8b. Read the comment docs.

@X-Guardian X-Guardian marked this pull request as ready for review February 11, 2020 13:21
@X-Guardian X-Guardian requested a review from johlju February 11, 2020 13:22
@X-Guardian X-Guardian added the needs review The pull request needs a code review. label Feb 11, 2020
Copy link
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 3 of 6 files at r1, 8 of 8 files at r3, 1 of 1 files at r4.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @X-Guardian)


CHANGELOG.md, line 35 at r4 (raw file):

Refactor. ([issue #560

Maybe remove this full stop after Refactor.

Btw. Some of the text you entered in the PR description would be suitable here too, it would improve the release notes. 🙂


source/ActiveDirectoryDsc.psd1, line 23 at r4 (raw file):

PowerShellVersion = '5.0'

Maybe this should be added to the change log? You think this is a breaking change? 🤔

@johlju
Copy link
Member

johlju commented Feb 11, 2020

Looks good to me. Just two tiny comments! Awesome work! 🙂

@johlju johlju added waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. and removed needs review The pull request needs a code review. labels Feb 11, 2020
Copy link
Contributor Author

@X-Guardian X-Guardian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @johlju)


CHANGELOG.md, line 35 at r4 (raw file):

Previously, johlju (Johan Ljunggren) wrote…
Refactor. ([issue #560

Maybe remove this full stop after Refactor.

Btw. Some of the text you entered in the PR description would be suitable here too, it would improve the release notes. 🙂

Done.

I also increased the markdownlint MD013 line length rule from 80 to 120 characters. (80 is too short!) and fixed all the long lines in the CHANGELOG.


source/ActiveDirectoryDsc.psd1, line 23 at r4 (raw file):

Previously, johlju (Johan Ljunggren) wrote…
PowerShellVersion = '5.0'

Maybe this should be added to the change log? You think this is a breaking change? 🤔

Good point. Done

@johlju johlju added needs review The pull request needs a code review. and removed waiting for code fix A review left open comments, and the pull request is waiting for changes to be pushed by the author. labels Feb 12, 2020
Copy link
Member

@johlju johlju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 2 of 2 files at r5.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved


CHANGELOG.md, line 35 at r4 (raw file):

Previously, X-Guardian (Simon Heather) wrote…

Done.

I also increased the markdownlint MD013 line length rule from 80 to 120 characters. (80 is too short!) and fixed all the long lines in the CHANGELOG.

It was 80 so that it is easier to review without having the text line-wrap. But if you want to have it at 120 that is no problem.

@johlju
Copy link
Member

johlju commented Feb 12, 2020

@X-Guardian Leave this so you can merge it correctly.

@johlju johlju added ready for merge The pull request was approved by the community and is ready to be merged by a maintainer. and removed needs review The pull request needs a code review. labels Feb 12, 2020
@X-Guardian X-Guardian changed the title ADDomain: Change Domain Install Tracking File to NetLogon Registry Test and Refactor BREAKING CHANGE: ADDomain: Change Domain Install Tracking File to NetLogon Registry Test and Refactor Feb 12, 2020
@X-Guardian X-Guardian merged commit 856f028 into dsccommunity:master Feb 12, 2020
@X-Guardian X-Guardian deleted the ADDomain-Refactor branch February 12, 2020 11:12
@X-Guardian X-Guardian removed the ready for merge The pull request was approved by the community and is ready to be merged by a maintainer. label Apr 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants